package com.example.controller;

import com.example.entity.Student;
import com.example.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author jukg
 * @date 2025/04/14 21:28
 * @description
 */
@RestController
public class StudentController {
    @Autowired
    private StudentService studentService;

    @GetMapping("/student")
    public Object getStudent(){
        List<Student> list = studentService.query();
        list.forEach(t -> System.out.println(t.toString()));
        list.clear();
        list.addAll(studentService.query2());
        list.forEach(t -> System.out.println(t.toString()));
        return list;
    }
}
